Docker : Install
2016/06/17 |
Install Docker which is the Operating System-Level Virtualization Tool, which automates the deployment of applications inside Containers.
|
|
[1] | Install Docker. |
root@dlp:~# apt-get -y install docker.io
|
[2] | Download the official image and create a Container and output the words "Welcome to the Docker World" inside the Container. |
# download official ubuntu image root@dlp:~# docker pull ubuntu
# run echo inside Container root@dlp:~# docker run ubuntu /bin/echo "Welcome to the Docker World!" Welcome to the Docker World! |
[3] | Connect to the interactive session of a Container with "i" and "t" option like follows. If exit from the Container session, the process of a Container finishes. |
root@dlp:~#
root@23f4a2724cbe:/# docker run -i -t ubuntu /bin/bash root@23f4a2724cbe:/# # Container's console
exit exit root@dlp:~# # back
|
[4] | If exit from the Container session with keeping container's process, push Ctrl+p, and Ctrl+q key. |
root@dlp:~#
docker run -i -t ubuntu /bin/bash root@8611c590f4fd:/# root@dlp:~# # Ctrl+p, Ctrl+q
# show docker process root@dlp:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8611c590f4fd ubuntu "/bin/bash" 19 seconds ago Up 18 seconds elegant_einstein # connect to container's session root@dlp:~# docker attach 8611c590f4fd root@8611c590f4fd:/# # shutdown container's process from Host's console root@dlp:~# docker kill 8611c590f4fd 8611c590f4fd root@dlp:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |